package yi.commons.tools.testbean;

import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import lombok.Data;


@Data
public class UserBean {

    @NotNull
    private Long id;

    @NotBlank
    private String name = "";

    @Min(0)
    @Max(120)
    private Integer age;

    @NotBlank
    @Pattern(regexp = DateRegexPattern.PATTERN_DATE_YYYYMMDD_SPLIT, message = "时间格式不正确(YYYY-MM-DD)")
    private String birthday;

    @NotBlank
    @Pattern(regexp = DateRegexPattern.PATTERN_DATETIME_YYYYMMDDHHMISS, message = "时间格式不正确(YYYY-MM-DD HH:mm:ss)")
    private String createTime;

    @NotBlank
    @Pattern(regexp = DateRegexPattern.PATTERN_DATE_YYYYMMDD, message = "时间格式不正确(YYYYMMDD)")
    private String createDate;

    private AddressBean addressExt;

    @Valid
    private AddressBean address;

}
